/*************************************************
* CHIPSEA F60 FRAMEWORK
* Copyright(c) 2018, NewDegreeTechnology, Inc.
**************************************************/

#include "hal_ndt_common.h"

#ifdef CS_F60

#ifndef HAL_CS_F60_FRAMEWORK_H
#define HAL_CS_F60_FRAMEWORK_H

///////////////////////////////////////////////////////////////////////////////////////////////////

/* Defien CHIPSEA F60 Parameter */

/* The parameter of DATA TABLE */
#define MD_COUNT			8
#define GA_COUNT			2

///////////////////////////////////////////////////////////////////////////////

/* The parameter of CPU */
#define CPU_PLL_BP                      0
#define CPU_PLL_OE                      0
#define CPU_PLL_SRC                     1
#define CPU_PLL_INDV                    PLL_INDIV_6
#define CPU_PLL_OUTDV                   PLL_OUTDIV_4
#define CPU_PLL_FBDV                    PLL_FBDIV_36

///////////////////////////////////////////////////////////////////////////////

/* The parameter of UART */
#define UART_BAUDRATE                   BaudRate_115200
#define UART_PARITY                     UART_Parity_No;
#define UART_WORDLENGTH                 UART_WordLength_8bit;
#define UART_STOPBITS                   UART_StopBit_1;

#define UART_FIFO_ENABLE                ENABLE;
#define UART_FIFO_RCVR                  FIFO_OneData;
#define UART_RIE_ENABLE                 DISABLE;

///////////////////////////////////////////////////////////////////////////////

/* The parameter of TIMER */
#define TIMER0_INTEN                    ENABLE
#define TIMER0_COUNTMODE                Timer_CountMode_Peroid
#define TIMER0_PRESCALE                 0
#define TIMER0_TCMP                     10

///////////////////////////////////////////////////////////////////////////////

/* The parameter of DELAY */
#define DELAY_SYSTICK_IEENABLE          DISABLE
#define DELAY_SYSTICK_RELOAD            10      //1ms

///////////////////////////////////////////////////////////////////////////////

/* The parameter of WDT */
#define WDT_PERIODTIME                  WDT_PeriodTime_2q14     //16384 * 0.1 ms ???1.6s
#define WDT_INT_WAKEUP_ENABLE           DISABLE                 //wdt 涓??????ら??
#define WDT_RESYSTEM_ENABLE             ENABLE                  //wdt 瓒????澶????
#define WDT_DELAY_TIME                  WDT_DelayTime_3CLK
#define WDT_INT_ENABLE                  DISABLE
#define WDT_ENABLE                      ENABLE

///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef BUILD_SW_ONLY
#define MCU_TM0_REG_VAL (TIMER0->TCMPR0)
#else
#define MCU_TM0_REG_VAL (st_sys_ctr.period)
#endif

/* CHIPSEA F60 Drivers */
#include "absacc.h"
#include "csa37fx60_afe.h"
#include "csa37fx60_fmc.h"
#include "csa37fx60_gpio.h"
#include "csa37fx60.h"
#include "csa37fx60_hdiv.h"
#include "csa37fx60_iic.h"
#include "csa37fx60_lib.h"
#include "csa37fx60_nvic.h"
#include "csa37fx60_pwr.h"
#include "csa37fx60_rcc.h"
#include "csa37fx60_system.h"
#include "csa37fx60_systick.h"
#include "csa37fx60_timer.h"
#include "csa37fx60_uart.h"
#include "csa37fx60_wdt.h"
#include "csa37fx60_wdt_smart.h"
#include "csa37fx60_wwdt.h"

///////////////////////////////////////////////////////////////////////////////

/* CHIPSEA F60 HAL */
#include "hal_cs_f60_timer.h"
#include "hal_cs_f60_uart.h"
#include "hal_cs_f60_gpio.h"
#include "hal_cs_f60_delay.h"
#include "hal_cs_f60_wdt.h"
#include "hal_cs_f60_flash.h"
#include "hal_cs_f60_tempsensor.h"
#include "hal_cs_f60_afe.h"
#include "hal_cs_f60_sleep.h"
#include "hal_cs_f60_iic.h"
#include "hal_cs_f60_power.h"
#include "hal_cs_f60_reg.h"
#include "hal_cs_f60_flash_rw.h"
///////////////////////////////////////////////////////////////////////////////////////////////////

#endif  /* HAL_CS_F60_FRAMEWORK_H */

#endif /* End of CS_F60 */
